<html>
<head>
<title>DOMParser namespace support</title>
<script src="../../resources/testharness.js"></script>
<script src="../../resources/testharnessreport.js"></script>
<script type="text/javascript">
test(() => {
  var parser = new DOMParser();
  var str =
    '<?xml version="1.0"?>\n<doc>\n  <foo xmlns="foobar" id="1">One</foo> <x:bar xmlns:x="barfoo" id="2">Two</x:bar>\n  <d id="3">Three</d>\n</doc>\n';
  var doc = parser.parseFromString(str,"text/xml");

  assert_equals(doc.getElementsByTagNameNS("foobar", "foo")[0].getAttribute("id"), "1");
  assert_equals(doc.getElementsByTagNameNS("barfoo", "bar")[0].getAttribute("id"), "2");
  assert_equals(doc.getElementsByTagNameNS("", "d")[0].getAttribute("id"), "3");
  assert_equals(doc.getElementsByTagNameNS(null, "d")[0].getAttribute("id"), "3");
}, "DOMParser namespace support");

</script>
</head>
<body>
</body>
</html>
